/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: NXP SFC driver Vendor Hooks
 */

#ifdef CONFIG_MTD_NXP_SFC

#if !defined(NXP_SFC_H) || defined(TRACE_HEADER_MULTI_READ)
#define NXP_SFC_H
#include <linux/mtd/spi-nor.h>
#include <linux/spi/spi.h>
#include "core.h"

void trace_nxp_sfc_probe(struct spi_nor *nor, struct spi_nor_hwcaps *hwcaps);
void trace_fsl_qspi_cs_active(struct spi_nor *nor);
void trace_fsl_qspi_cs_deactive(struct spi_nor *nor);
void trace_nxp_sfc_init_spec(struct spi_nor *nor);
void trace_nxp_sfc_exit_spec(void);
void trace_nxp_sfc_set_mask(struct spi_nor *nor, int *ignored_mask);
bool trace_nxp_sfc_set_default_mode(struct spi_nor *nor, u8 *id,
	const struct flash_info **info);
void trace_nxp_sfc_sfdp_init_params(struct spi_nor *nor,
	void (*sfdp_func)(struct spi_nor *));
void trace_nxp_sfc_quad_enable(struct spi_nor *nor);
#endif

#else

#include <linux/tracepoint.h>
struct spi_nor;
struct spi_nor_hwcaps;

DECLARE_EVENT_NOP(nxp_sfc_probe,
	TP_PROTO(struct spi_nor *nor, struct spi_nor_hwcaps *hwcaps),
	TP_ARGS(nor, hwcaps));

DECLARE_EVENT_NOP(fsl_qspi_cs_active,
	TP_PROTO(struct spi_nor *nor),
	TP_ARGS(nor));

DECLARE_EVENT_NOP(fsl_qspi_cs_deactive,
	TP_PROTO(struct spi_nor *nor),
	TP_ARGS(nor));

DECLARE_EVENT_NOP(nxp_sfc_init_spec,
	TP_PROTO(struct spi_nor *nor),
	TP_ARGS(nor));

DECLARE_EVENT_NOP(nxp_sfc_exit_spec,
	TP_PROTO(void),
	TP_ARGS());

DECLARE_EVENT_NOP(nxp_sfc_set_mask,
	TP_PROTO(struct spi_nor *nor, int *ignored_mask),
	TP_ARGS(nor, ignored_mask));

static inline bool trace_nxp_sfc_set_default_mode(struct spi_nor *nor, u8 *id,
	const struct flash_info **info)
{
	return false;
}

DECLARE_EVENT_NOP(nxp_sfc_sfdp_init_params,
	TP_PROTO(struct spi_nor *nor,
	void (*sfdp_func)(struct spi_nor *)),
	TP_ARGS(nor, sfdp_func));

DECLARE_EVENT_NOP(nxp_sfc_quad_enable,
	TP_PROTO(struct spi_nor *nor),
	TP_ARGS(nor));

#endif

